﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Kkc.Model.Announcement>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Ny artikkel
</asp:Content>

<asp:Content ID="HeadContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script type="text/javascript">
        $(function() {
            $.datepicker.setDefaults($.extend({ showMonthAfterYear: false }, $.datepicker.regional['']));
            $(".datePicker").datepicker({
                showOn: 'button',
                buttonImage: '<%= Url.Content("~/Content/images/calendar.gif") %>',
                buttonImageOnly: true,
                constrainInput: true,
                dateFormat: 'dd.mm.yy',
                defaultDate: '+6m',
                firstDay: 1,
                minDate: 0
            });
            $(".datePicker").datepicker($.datepicker.regional['no']);
            $(".rte-zone").rte({
                css_url: "<%= Url.Content("~/Content/rte.css") %>",
                media_url: "<%= Url.Content("~/Content/Images/") %>"
            });
        });        
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Opprett ny artikkel</h2>

    <%= Html.ValidationSummary("Lagringen kunne ikke fullføres på grunn av feil inntastede verdier. Venligst rett feilene og prøv igjen.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Felt</legend>
            <p>
                <label for="Title">Tittel:</label>
                <%= Html.TextBox("Title", string.Empty, new { @class = "full" })%>
                <%= Html.ValidationMessage("Title", "*") %>
            </p>
            <p>
                <label for="Summary">Sammendrag:</label>
                <%= Html.TextArea("Summary", new { @class = "full" })%>
                <%= Html.ValidationMessage("Summary", "*") %>
            </p>
            <p>
                <label for="Body">Brødtekst:</label>
                <%= Html.TextArea("Body", new { @class = "rte-zone full" }) %>
                <%= Html.ValidationMessage("Body", "*") %>
            </p>
            <p>
                <label for="Link">Lenke:</label>
                <%= Html.TextBox("Link", string.Empty, new { @class = "full" })%>
                <%= Html.ValidationMessage("Link", "*") %>
            </p>
            <p>
                <label for="Link">Gyldig til:</label>
                <%= Html.TextBox("ExpirationDate", string.Empty, new { @class = "datePicker" })%>
                <%= Html.ValidationMessage("ExpirationDate", "*") %>
            </p>
            <p>
                <input class="button button-big" type="submit" value="Lagre" />
            </p>
        </fieldset>

    <% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftSideContent" runat="server">
    <ul>
        <li class="first"><%=Html.ActionLink("Tilbake til nyheter", "Index") %></li>
    </ul>
</asp:Content>